home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / InternalFrameEvent.java < prev    next >
Text File  |  1998-06-30  |  5KB  |  145 lines

  1. /*
  2.  * @(#)InternalFrameEvent.java    1.4 98/02/02
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  *
  19.  */
  20. package com.sun.java.swing.event;
  21.  
  22. import java.awt.AWTEvent;
  23. import com.sun.java.swing.JInternalFrame;
  24.  
  25. /**
  26.  * InternalFrameEvent:  an AWTEvent which adds support for
  27.  * JInternalFrame objects as the event source.  This class has the
  28.  * same event types as WindowEvent, although different ids are used.
  29.  * <p>
  30.  * Warning: serialized objects of this class will not be compatible with
  31.  * future swing releases.  The current serialization support is appropriate
  32.  * for short term storage or RMI between Swing1.0 applications.  It will
  33.  * not be possible to load serialized Swing1.0 objects with future releases
  34.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  35.  * baseline for the serialized form of Swing objects.
  36.  *
  37.  * @see java.awt.event.WindowEvent
  38.  * @see java.awt.event.WindowListener
  39.  * @version 1.4 02/02/98
  40.  * @author Thomas Ball
  41.  */
  42. public class InternalFrameEvent extends AWTEvent {
  43.  
  44.     /**
  45.      * The first number in the range of ids used for window events.
  46.      */
  47.     public static final int INTERNAL_FRAME_FIRST        = 25549;
  48.  
  49.     /**
  50.      * The last number in the range of ids used for window events.
  51.      */
  52.     public static final int INTERNAL_FRAME_LAST         = 25555;
  53.  
  54.     /**
  55.      * The window opened event.  This event is delivered only
  56.      * the first time a window is made visible.
  57.      */
  58.     public static final int INTERNAL_FRAME_OPENED    = INTERNAL_FRAME_FIRST;
  59.  
  60.     /**
  61.      * The "window is closing" event. This event is delivered when
  62.      * the user selects "Quit" from the window's system menu.  If
  63.      * the program does not explicitly hide or destroy the window as
  64.      * while processing this event, the window close operation will be
  65.      * canceled.
  66.      */
  67.     public static final int INTERNAL_FRAME_CLOSING    = 1 + INTERNAL_FRAME_FIRST;
  68.  
  69.     /**
  70.      * The window closed event. This event is delivered after
  71.      * the window has been closed as the result of a call to hide or
  72.      * destroy.
  73.      */
  74.     public static final int INTERNAL_FRAME_CLOSED    = 2 + INTERNAL_FRAME_FIRST;
  75.  
  76.     /**
  77.      * The window iconified event. This event indicates that the window
  78.      * was shrunk down to a small icon.
  79.      */
  80.     public static final int INTERNAL_FRAME_ICONIFIED    = 3 + INTERNAL_FRAME_FIRST;
  81.  
  82.     /**
  83.      * The window deiconified event type. This event indicates that the
  84.      * window has been restored to its normal size.
  85.      */
  86.     public static final int INTERNAL_FRAME_DEICONIFIED  = 4 + INTERNAL_FRAME_FIRST;
  87.  
  88.     /**
  89.      * The window activated event type. This event indicates that keystrokes
  90.      * and mouse clicks are directed towards this window.
  91.      */
  92.     public static final int INTERNAL_FRAME_ACTIVATED    = 5 + INTERNAL_FRAME_FIRST;
  93.  
  94.     /**
  95.      * The window deactivated event type. This event indicates that keystrokes
  96.      * and mouse clicks are no longer directed to the window.
  97.      */
  98.     public static final int INTERNAL_FRAME_DEACTIVATED    = 6 + INTERNAL_FRAME_FIRST;
  99.  
  100.     /**
  101.      * Constructs a InternalFrameEvent object.
  102.      * @param source the JInternalFrame object that originated the event
  103.      * @param id     an integer indicating the type of event
  104.      */
  105.     public InternalFrameEvent(JInternalFrame source, int id) {
  106.         super(source, id);
  107.     }
  108.  
  109.     /**
  110.      * Returns a parameter string identifying this event.
  111.      * This method is useful for event-logging and for debugging.
  112.      *
  113.      * @return a string identifying the event and its attributes
  114.      */
  115.     public String paramString() {
  116.         String typeStr;
  117.         switch(id) {
  118.           case INTERNAL_FRAME_OPENED:
  119.               typeStr = "INTERNAL_FRAME_OPENED";
  120.               break;
  121.           case INTERNAL_FRAME_CLOSING:
  122.               typeStr = "INTERNAL_FRAME_CLOSING";
  123.               break;
  124.           case INTERNAL_FRAME_CLOSED:
  125.               typeStr = "INTERNAL_FRAME_CLOSED";
  126.               break;
  127.           case INTERNAL_FRAME_ICONIFIED:
  128.               typeStr = "INTERNAL_FRAME_ICONIFIED";
  129.               break;
  130.           case INTERNAL_FRAME_DEICONIFIED:
  131.               typeStr = "INTERNAL_FRAME_DEICONIFIED";
  132.               break;
  133.           case INTERNAL_FRAME_ACTIVATED:
  134.               typeStr = "INTERNAL_FRAME_ACTIVATED";
  135.               break;
  136.           case INTERNAL_FRAME_DEACTIVATED:
  137.               typeStr = "INTERNAL_FRAME_DEACTIVATED";
  138.               break;
  139.           default:
  140.               typeStr = "unknown type";
  141.         }
  142.         return typeStr;
  143.     }
  144. }
  145.